{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "a659ae35",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "请输入您的账号：biyan\n",
      "请输入您的密码：12345\n",
      "欢迎的用户 biyan 欢迎登陆系统使用\n",
      "亲爱的用户，您还有 4 次登录机会\n",
      "您想以哪种方式查看课表：1.查看今天的课表 2.查看指定日期的课表\n",
      "请输入你的选择: 1\n",
      "2021-10-13 22:33:00\n",
      "自由安排\n",
      "欢迎的用户 biyan 欢迎登陆系统使用\n",
      "亲爱的用户，您还有 3 次登录机会\n",
      "您想以哪种方式查看课表：1.查看今天的课表 2.查看指定日期的课表\n",
      "请输入你的选择: 1\n",
      "2021-10-13 22:33:00\n",
      "自由安排\n",
      "欢迎的用户 biyan 欢迎登陆系统使用\n",
      "亲爱的用户，您还有 2 次登录机会\n",
      "您想以哪种方式查看课表：1.查看今天的课表 2.查看指定日期的课表\n"
     ]
    }
   ],
   "source": [
    "from datetime import datetime\n",
    "from calendar import *\n",
    "Monday = [6,13,20,27]\n",
    "Tuesday = [7,14,21,28]\n",
    "Wednesday = [8,15,22,29]\n",
    "Thursday = [9,16,23,30]\n",
    "Friday = [3,10,17,24]\n",
    "\n",
    "# datetime 模块的运用，自定义？\n",
    "now =  datetime.today().day # 表示今日日期中的天\n",
    "time = datetime.today().hour# 表示今日日期中的小时\n",
    "此刻 = datetime.now().strftime(\"%Y-%m-%d %H:%M:%S\") # 表示输出时的时间\n",
    "\n",
    "schedule_day = {\"周一\":[\"自由安排\"],\n",
    "              \"周二\":[\"1-3节 用户研究 3实312\",\"8-10节 网站运营与管理 3实304\",\"12-14节 创业基础实践 1-205\"],\n",
    "                \"周三\":[\"3-5节 棒垒球 西区操场\",\"4-5节 大学英语B1班 10-203\",\"12-14 网页设计 7-401\"],\n",
    "                \"周四\":[\"3-5节 Python语言 新综合楼612\"],\n",
    "                \"周五\":[\"1-2节 大学英语B1班 10-202 \",\"3-5节 大数据 7-402\"]}\n",
    " # 无序数据结构--字典--课本p51\n",
    "    \n",
    "user_data = \"biyan\"\n",
    "password_data = \"12345\"\n",
    "user_date_VIP = \"biyanvip\"\n",
    "password_date_VIP = \"12345vip\"\n",
    "\n",
    "# 输入次数\n",
    "count = 3\n",
    "while True:\n",
    "    count -= 1\n",
    "# 用户输入数据，会员可输入10次，非会员可输入5次\n",
    "    username = input(\"请输入您的账号：\")\n",
    "    password = input(\"请输入您的密码：\")\n",
    "    # 1. 第一步，先判断账号是否为会员\n",
    "    # 会员,非会员，注意层级书写格式\n",
    "    if user_data == username:\n",
    "            if password_data == password:\n",
    "                count = 5\n",
    "                while True:\n",
    "                    count -=1\n",
    "                    print(\"欢迎的用户\",username,\"欢迎登陆系统使用\" )\n",
    "                    print(\"亲爱的用户，您还有\",count,\"次登录机会\")\n",
    "                    print(\"您想以哪种方式查看课表：1.查看今天的课表 2.查看指定日期的课表\")\n",
    "                    choice = int(input(\"请输入你的选择: \"))\n",
    "                    if choice == 1:\n",
    "                        if now in Monday:\n",
    "                            print(此刻)\n",
    "                            print(\"自由安排\")\n",
    "                    elif now in Tuesday:\n",
    "                        print(此刻)\n",
    "                        print( \"1-3节 用户研究 3实312\",\"8-10节 网站运营与管理 3实304\",\"12-14节 创业基础实践 1-205\")\n",
    "                    elif now in Wednesday:\n",
    "                        print(此刻)\n",
    "                        print(\"3-5节 棒垒球 西区操场\",\"4-5节 大学英语B1班 10-203\",\"12-14 网页设计 7-401\")\n",
    "                    elif now in Thursday:\n",
    "                        print(此刻)\n",
    "                        print(\"3-5节 Python语言 新综合楼612\")\n",
    "                    elif now in Friday:\n",
    "                        print(此刻)\n",
    "                        print(\"1-2节 大学英语B1班 10-202 \",\"3-5节 大数据 7-402\")\n",
    "                    else:\n",
    "                        print(此刻)\n",
    "                        print(\"休息\")\n",
    "    else:\n",
    "                if count == 0:\n",
    "                    print(\"您输入的账号或密码不正确，请1分钟后再尝试输入\")\n",
    "                    break\n",
    "                else:\n",
    "                    print(\"您输入的账号或密码不正确，请重新输入，您还有\", count, \"次机会\")\n",
    "                    "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "199ad8a2",
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.8.8"
  },
  "toc": {
   "base_numbering": 1,
   "nav_menu": {},
   "number_sections": true,
   "sideBar": true,
   "skip_h1_title": false,
   "title_cell": "Table of Contents",
   "title_sidebar": "Contents",
   "toc_cell": false,
   "toc_position": {},
   "toc_section_display": true,
   "toc_window_display": false
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
